package com.huawei.hianalytics.ab.de;

import android.util.Pair;
import com.huawei.hianalytics.ab.ab.cd;
import com.huawei.hianalytics.ab.bc.cd.bc.ef;
import com.huawei.hianalytics.ab.bc.de.de;
import com.huawei.hianalytics.ab.bc.de.gh;
import com.huawei.hianalytics.ab.ef.bc;
import java.util.List;
import java.util.Map;

public class ab extends de {
    public static ef ab(List<com.huawei.hianalytics.ab.bc.cd.bc.de> list, String str, String str2, String str3, String str4) {
        com.huawei.hianalytics.ab.bc.ef.ab.bc("hmsSdk", "generate UploadData");
        ef ab = de.ab();
        if (ab == null) {
            return null;
        }
        ab.ab(bc(gh.ab().de(), str, str2, str3));
        ab.ab(cd(str, str2));
        ab.ab(bc(str2, str, str4));
        ab.ab(cd.fg(str, str2));
        ab.ab((List) list);
        return ab;
    }

    protected static bc bc(String str, String str2, String str3, String str4) {
        bc ab = de.ab(str, str2, str3, str4);
        String ab2 = com.huawei.hianalytics.ab.cd.bc.ab.ab().ab(cd.kl(str2, str3));
        long currentTimeMillis = System.currentTimeMillis();
        ab2 = com.huawei.hianalytics.ab.bc.ab.bc.ab().ab(com.huawei.hianalytics.ab.ab.bc.ef() + ab2 + currentTimeMillis);
        ab.bc(String.valueOf(currentTimeMillis));
        ab.gh(ab2);
        return ab;
    }

    protected static com.huawei.hianalytics.ab.ef.cd bc(String str, String str2, String str3) {
        com.huawei.hianalytics.ab.ef.cd ab = de.ab(str, str2, str3);
        Pair bc = com.huawei.hianalytics.ab.cd.bc.ab.ab().bc(str2, str);
        ab.fg((String) bc.first);
        ab.gh((String) bc.second);
        ab.ef(com.huawei.hianalytics.ab.cd.bc.ab.ab().fg(str2, str));
        return ab;
    }

    protected static com.huawei.hianalytics.ab.ef.ab cd(String str, String str2) {
        com.huawei.hianalytics.ab.ef.ab ab = de.ab(str, str2);
        com.huawei.hianalytics.ab.cd.ab.ab ab2 = com.huawei.hianalytics.ab.cd.bc.ab.ab().ab(str, str2);
        ab.fg(com.huawei.hianalytics.ab.cd.bc.ab.ab().ab(cd.kl(str, str2)));
        ab.de(cd.ab(str, str2));
        ab.gh(com.huawei.hianalytics.ab.cd.bc.ab.ab().cd(str, str2));
        switch (ab2.ab()) {
            case SN:
                ab.cd(ab2.bc());
                break;
            case IMEI:
                ab.bc(ab2.bc());
                break;
            case UDID:
                ab.ef(ab2.bc());
                break;
        }
        return ab;
    }

    public static Map<String, String> cd(String str, String str2, String str3) {
        Map<String, String> bc = de.bc(str, str3);
        Map lm = cd.lm(str, str2);
        if (lm != null) {
            bc.putAll(lm);
        }
        return bc;
    }
}
